package com.link2room.soundwave.service.impl;

import com.link2room.common.service.ICommonService;
import com.link2room.common.util.ClassConverUtil;
import com.link2room.soundwave.entity.L2RIpms2Member;
import com.link2room.soundwave.entity.L2RIpms2MemberUnbind;
import com.link2room.soundwave.service.IGcPmsMemberService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by sss on 2017/6/7.
 */
@Service("gcPmsMemberService")
public class GcPmsMemberServiceImpl implements IGcPmsMemberService {
    @Resource
    private ICommonService commonService;

    @Override
    @Transactional
    public void unbindL2RIpms2Member(L2RIpms2Member l2RIpms2Member) throws Exception {
        L2RIpms2MemberUnbind l2RIpms2MemberUnbind;
        l2RIpms2MemberUnbind = ClassConverUtil.copyProperties(l2RIpms2Member, L2RIpms2MemberUnbind.class);
        l2RIpms2MemberUnbind.setId(null);
        commonService.save(l2RIpms2MemberUnbind);
        commonService.delete(L2RIpms2Member.class, l2RIpms2Member.getId());
    }
}
